<?php $local_path = sfConfig::get('sf_web_dir') . '/uploads/profile_pictures/' . $username . '_thumb.jpg' ?>
<?php if(file_exists($local_path)){ ?>
<?php $path = get_resized_image('116', '108', $local_path) ?>
<?php $small_path = get_resized_image('36', '36', $local_path) ?>
<?php } else { ?>
<?php $path = image_path('demo_upload.gif') ?>
<?php $small_path = image_path('demo_upload.gif') ?>
<?php } ?>
<img width="116" height="108" src="<?php echo $path ?>?_=<?php echo time() ?>"/>
<script>
    top.$('#small_user_pic').attr('src', '<?php echo $small_path ?>?_=<?php echo time() ?>');
</script>